/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package interfazAWT;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Canvas;
import java.awt.Checkbox;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;

import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Label;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.Panel;
import java.awt.TextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;


/**
 *
 * @author djdracku
 */
public class Paint2 {

     Frame f=new Frame("Bienvenido Buscaminas");
    Panel ocul=new Panel();
    TextArea t=new TextArea();
    Panel arri=new Panel();
    Menu me = new Menu("Archivo");
    Menu mi = new Menu("Ver");
        MenuBar bar = new MenuBar();
        MenuItem mi1 = new MenuItem("Nuevo");
        MenuItem mi5 = new MenuItem("Abrir");
        MenuItem mi4 = new MenuItem("Guardar");
        MenuItem mi2 = new MenuItem("Salir");
        MenuItem mi3 = new MenuItem("Ver");





     public void visible() {


        f.setBackground(Color.BLACK);
        ocul.setLayout(new GridLayout(7, 7));
        f.setSize(600, 600);
        f.setResizable(false);


         mi2.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });



        f.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });


        mi1.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

              Paint p=new Paint();
              p.visible();
              f.dispose();

            }
        });


         mi3.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

              Paint2 p=new Paint2();
              p.visible();
              f.dispose();

            }
        });

         mi4.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

             Ventana v=new Ventana();
             v.visible();
             f.dispose();

            }
        });

         mi5.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

             AbrirAchivo a=new AbrirAchivo();
             a.visible();
             f.dispose();

            }
        });


        Panel p21=new Panel();
        Checkbox c=new Checkbox("");
        Checkbox c2=new Checkbox("");
        Checkbox c3=new Checkbox("");
        Label l=new Label("Reglas");
        Label l4=new Label("Cuadricula");
        Label l5=new Label("Barra de estado");

        p21.setLayout(new GridLayout(3, 1));
       


        p21.setBackground(Color.WHITE);


        p21.add(c);
        p21.add(l);
        p21.add(c2);
        p21.add(l4);
        p21.add(c3);
        p21.add(l5);


  Panel p19=new Panel();
p19.setLayout(new GridLayout(1,1));

Panel p20=new Panel();
Label l1=new Label("Acercar");
Label l2=new Label("Alejar");

p19.add(p20);

p20.setLayout(new GridLayout(2,3));
p20.setBackground(Color.WHITE);
      Button b19 = new Button(""){
       public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/ZomMas.PNG"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };


              Button b24 = new Button(""){
                   public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/ZoomMenos.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };

              

      p20.add(b19);
      p20.add(b24);
      p20.add(l1);
      p20.add(l2);
     





        Panel p12=new Panel();
p12.setLayout(new GridLayout(1,1));
Panel p121=new Panel();
Label l3=new Label("Pantalla Completa");

p12.setBackground(Color.WHITE);
p12.add(p121);

p121.setLayout(new GridLayout(3,4));
      Button b11 = new Button(""){
       public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/PantallaCompleta.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };

       

      p121.add(b11);
      p121.add(l3);
      




      Panel p22=new Panel();
      p22.setBackground(Color.WHITE);
      Panel p23=new Panel();
      p23.setBackground(Color.WHITE);

        arri.setLayout(new GridLayout(1,2));
        arri.add(p19);
        arri.add(p21);
        arri.add(p12);
        arri.add(p22);
        arri.add(p23);
      

        //f.add(arri);

        f.add(BorderLayout.NORTH, arri);
        f.add(BorderLayout.CENTER, t);



        me.add(mi1);
        me.add(mi5);
        me.add(mi4);
        me.add(mi2);
        mi.add(mi3);
        bar.add(me);
        bar.add(mi);
        f.setMenuBar(bar);

        f.setLocation(200, 100);
        f.setVisible(true);


    }




   public static void main(String args[]){



   Paint2 p=new Paint2();
   p.visible();

    }


}
